package wwk.com.android_meilishuo.ui.assort;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.wwk.core.utils.RecyclerViewAdapterHelper;

import java.util.List;

import wwk.com.android_meilishuo.R;
import wwk.com.android_meilishuo.ui.home.bean.ListBean;

/**
 * Created by Administrator on 2017/1/6.
 */

public class Category2AssortRecyclerAdapter extends RecyclerViewAdapterHelper<ListBean> {
    public Category2AssortRecyclerAdapter(Context context, List<ListBean> list) {
        super(context, list);
    }

    @Override
    public RecyclerView.ViewHolder onCreateMyViewHolder(ViewGroup parent, int viewType) {
        View view = mInflater.inflate(R.layout.item_category2_recyclerview, null);
        return new MyViewHolder(view);
    }

    @Override
    public void onBindMyViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof MyViewHolder) {
            MyViewHolder myViewHolder = (MyViewHolder) holder;
            ListBean listBean = mList.get(position);
            Glide.with(mContext).load(listBean.getImage()).into(myViewHolder.imageView_assort_recycler);
        }

    }

    class MyViewHolder extends RecyclerView.ViewHolder {
        private ImageView imageView_assort_recycler;

        public MyViewHolder(View itemView) {
            super(itemView);
            imageView_assort_recycler = (ImageView) itemView.findViewById(R.id.imageView_Category2_recycler);
        }
    }
}
